package com.fly.user.client;

import com.fly.common.common.ErrorConstant;
import com.fly.common.model.OrderEntity;
import com.fly.common.vo.ResponseVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @author fly
 * @description 订单服务降级实现
 * @date 2019/9/26 12:03
 */
@Component
@Slf4j
public class OrderClientFallback implements OrderClient {
    @Override
    public ResponseVO<List<OrderEntity>> queryOrderByUserId(Long userId) {
        log.info("调用订单服务异常，降级 user_id -> {}", userId);
        return new ResponseVO<>(ErrorConstant.SUCCESS, ErrorConstant.SUCCESS_MSG, new ArrayList<>());
    }
}
